Field of the Disclosure
The present disclosure relates generally to processing systems and, more particularly, to compilation of programs executed by processing systems.
Description of the Related Art
Conventional compilers assume that each variable in a program must be represented by a fixed number of bits associated with the declared type of the variable. For example, all variables declared as the type integer may be represented by 64 bits. Some high-level programming languages allow variables of the same type, such as type pointer, to be represented by different numbers of bits. For example, the specification of the large machine model of the heterogeneous system architecture (HSA) intermediate language (HSAIL) uses 64 bits to represent pointers to memory locations in a global address space and 32 bits to represent pointers to memory locations in a local address space shared by tasks in a workgroup and the private address spaces of the individual tasks. However, the variables in a program may not actually use all of the allocated bits during execution of the program. Representing the variables by the full number of bits allocated to the corresponding variable type wastes computational resources. For example, representing all of the pointers in HSAIL variables by 64 bits requires applying computationally expensive 64-bit address calculations to determine addresses to memory locations in the global, local, and private address spaces.